let path = require('path');
let HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  // 解析指定模块的地址
  resolve: {
    //模块查找顺序：先找/source找不到才找/node_modules
    modules: [
      path.resolve(__dirname, 'source'),
      path.resolve(__dirname, 'node_modules')
    ]
  },
  devtool: 'source-map',
  plugins: [
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, 'public/index.html')
    })
  ]
}